package cn.throwx.sc.ch2;

import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * @author throwable
 * @version v1
 * @description NoOpPasswordEncoder demo
 * @since 2021/10/30 13:12
 */
public class NoOpPasswordEncoderDemo {

    private static final String RAW_PD = "throwable";

    public static void main(String[] args) {
        PasswordEncoder passwordEncoder = NoOpPasswordEncoder.getInstance();
        String encodedPassword = passwordEncoder.encode(RAW_PD);
        System.out.printf("[noop]raw:%s,encoded:%s,match:%s\n", RAW_PD, encodedPassword,
                passwordEncoder.matches(RAW_PD, encodedPassword));
    }
}
